<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // ES6 允许在大括号里面,直接写入变量和函数,作为对象的属性和方法
      let name = "张三";
      let change = function () {
        console.log("change");
      };
      const learn = {
        name,
        // name:name
        change,
        // change:change
      };
      // 方法声明简化
      const obj = {
        say() {
          console.log("hello");
        },
        /* say: function () {
          console.log("hello");
        }, */
      };
    </script>
  </body>
</html>
